package com.itcam.phaseii.exception_;

public class NullPointerException_ {
    public static void main(String[] args) {
        String name = null;
        try {
            System.out.println(name.length());
        } catch (java.lang.Exception e) {
//            throw new RuntimeException(e);
            System.out.println("出现异常的类型: " + e.getClass() + " " + e.getMessage());//输出异常信息
        }
    }
}
